package com.ds.home.proxy;

import com.alibaba.fastjson.annotation.JSONField;
import com.ds.home.EIAlarm;
import com.ds.home.engine.AppEngine;
import com.ds.iot.Alarm;
import com.ds.iot.HomeException;
import com.ds.iot.Scene;

public class AlarmProxy implements Alarm{


	@JSONField(serialize=false)
	
	private transient EIAlarm dbAlarm;
	private String systemCode;

	public AlarmProxy(EIAlarm dbAlarm,String systemCode){
		this.dbAlarm=dbAlarm;
		this.systemCode=systemCode;

	}
	

	public String getAlarmid() {
		return dbAlarm.getAlarmid();
	}

	public String getAlertcontent() {
		return dbAlarm.getAlertcontent();
	}

	public String getComfort() {
		return dbAlarm.getComfort();
	}

	public String getCycle() {
		return dbAlarm.getCycle();
	}

	public Integer getDelaytime() {
		return dbAlarm.getDelaytime();
	}

	public Integer getDevicestatus() {
		return dbAlarm.getDevicestatus();
	}

	public String getEndtime() {
		return dbAlarm.getEndtime();
	}

	public Integer getIstart() {
		return dbAlarm.getIstart();
	}

	public String getName() {

		return dbAlarm.getName();
	}

	public Integer getOperatestatus() {
		return dbAlarm.getOperatestatus();
	}

	public String getSceneid() {
		return dbAlarm.getSceneid();
	}

	public String getSensorid() {
		
		return dbAlarm.getSensorid();
	}

	public String getStarttime() {
		return dbAlarm.getStarttime();
	}

	

	public void setAlertcontent(String alertcontent) {
		dbAlarm.setAlertcontent(alertcontent);
	}

	public void setComfort(String comfort) {
		dbAlarm.setComfort(comfort);
	}

	public void setCycle(String cycle) {
		dbAlarm.setCycle(cycle);
	}

	public void setDelaytime(Integer delaytime) {
		dbAlarm.setDelaytime(delaytime);
	}

	public void setDevicestatus(Integer devicestatus) {
		dbAlarm.setDevicestatus(devicestatus);
	}

	public void setEndtime(String endtime) {
		dbAlarm.setEndtime(endtime);
	}

	public void setIstart(Integer istart) {
		dbAlarm.setIstart(istart);
	}

	public void setName(String name) {
		dbAlarm.setName(name);
	}

	public void setOperatestatus(Integer operatestatus) {
		dbAlarm.setOperatestatus(operatestatus);
	}

	public void setSceneid(String sceneid) {
		dbAlarm.setSceneid(sceneid);
	}

	public void setSensorid(String sensorid) {
		dbAlarm.setSensorid(sensorid);
	}

	@JSONField(serialize=false)
	
	public Alarm clone(String alarmId) {
		return new AlarmProxy(dbAlarm.clone(alarmId),this.systemCode

		);
	}

	public void setStarttime(String starttime) {
		dbAlarm.setStarttime(starttime);
	}
	@JSONField(serialize=false)
	
	public Scene getScene() {
		Scene scene=null;
		if (this.getSceneid()!=null){
			try {

				scene=AppEngine.getEngine(systemCode).getSceneById(this.getSceneid());
			} catch (HomeException e) {
				// TODO Auto-generated catch block
				//e.printStackTrace();
			}
		}
	
		return scene;
	}
	

}
